package module.dao;

import common.annotation.DaoSql;
import common.annotation.QueryDao;
import common.bean.SearchPageResult;
import common.bean.SearchParameter;
import common.dao.BaseDao;
import module.model.UserModel;

@QueryDao
public interface UserDao extends BaseDao<Long,UserModel> {

    @DaoSql(sql="SELECT * FROM USER_USER WHERE USER_STATUS=0  { AND USER_NAME=:name } limit 1 ",resultType = "Model[UserModelMapping]")
    public UserModel getUserBySearchParameter(SearchParameter searchParameter);

    @DaoSql(sql="SELECT * FROM USER_USER WHERE 1=1 { and USER_NAME=:name} { and USER_MOBILE=:mobile} { and USER_MAIL=:email} order by CREATE_DATE desc",resultType = "Page[UserModelMapping]")
    public SearchPageResult<UserModel> getUserModelListPage(SearchParameter searchParameter);
}
